<!DOCTYPE html PUBLIC>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>修改战队的审核状态</title>
    <link href="$!webPath/css/template.css" rel="stylesheet" type="text/css"/>
    <link href="$!webPath/css/jquery-ui-1.8.22.custom.css" type="text/css" rel="stylesheet">
    <script src="$!webPath/js/jquery.min.js"></script>
    <script src="$!webPath/js/jquery-1.6.2.js"></script>
    <script src="$!webPath/js/jquery-ui-1.8.21.js"></script>
    <script src="$!webPath/js/ajaxfileupload.js"></script>

    <style type="text/css">
        label.error {
            color: #F00;
            margin-left: 3px;
        }

        input.error {
            border: 2px solid #F00;
        }
        .close{
            position: absolute;
            right: 0;
            bottom: 0;
            z-index: 99;
            width: 30px;
            height:20px;
        }
    </style>
</head>
<body>
<div class="header_nav">
    <iframe name="content_frame" src="$!webPath/admin/nav" marginwidth=0 marginheight=0  frameborder=0 width=100% height=80/></iframe>
    <div class="cont_right"><a href="$!webPath/login">注销</a></div>
</div>
<div class="cont">
    <h3 class="seth">编辑</h3>
    <div class="nav_list">
        <ul id="ul_table">
            <li><a href="$!webPath/admin/teamList?size=10&page=0"><b>战队列表</b></a></li>
            <li><a href="javascript:void(0);" class="this"><b>编辑</b></a></li>
        </ul>
    </div>
    <div class="adddetail">
        <form action="$!webPath/admin/" method="post" name="theForm" id="theForm">

            <div class="edit">
                <div class="setcont editul">
                    <ul class="set1">
                        <li class="setcont_bg">战队名称</li>
                        <li>
                        <span class="webname">
                            <input type="text" id="teamName" value="$!team.name"/>
                        </span>
                        </li>
                        <li>
                            <span class="webname">
                            <input type="button" id="btn_teamName" value="修改战队名称"/>
                            </span>
                        </li>
                    </ul>
                    <table width="100%" border="1" cellspacing="0" cellpadding="0" class="fshop_table">
                        <tr>
                            <th width="" align="center">昵称</th>
                            <th width="" align="center">手机号</th>
                            <th width="" align="center">战队身份</th>
                            <th width="" align="center">所属战队</th>
                            <th width="" align="center">创建时间</th>
                            <th width="" align="center">更新时间</th>
                            <th width="" align="center">创建人</th>
                            <th width="" align="center">更新人</th>
                            <th width="" align="center">位置</th>
                            <th width="" align="center">证件照</th>
                            <th width="" align="center">状态</th>
                        </tr>
                        <tbody id="user_list">
                        #foreach($obj in $!users)
                        <tr>
                            #if($!obj.nickname!='')
                            <td align="center">$!obj.nickname</td>
                            #else
                            <td align="center">$!obj.userWxNickname</td>
                            #end
                            <td align="center">$!obj.mobile</td>
                            #if($!obj.isCaption==0)
                            <td align="center">队员</td>
                            #elseif($!obj.isCaption==1)
                            <td align="center">队长</td>
                            #end
                            <td align="center">$!obj.teamEntity.name</td>
                            <td align="center">$!obj.createdAt</td>
                            <td align="center">$!obj.updateAt</td>
                            <td align="center">$!obj.createdBy</td>
                            <td align="center">$!obj.updateBy</td>
                            #if($!obj.idCardPicPath!='')
                            <td align="center">$!obj.idCardPicPath</td>
                            #else
                            <td align="center">$!obj.userWxPicPath</td>
                            #end
                            <td>
                                <img src="$!webPath/$!obj.idCardPicPath" onclick="showBigImg('$!webPath/$!obj.idCardPicPath')" width="50" height="30"/>
                            </td>
                            #if($!obj.userStatus==0)
                            <td align="center">未激活</td>
                            #else
                            <td align="center">已激活</td>
                            #end
                        </tr>
                        #end
                        </tbody>
                    </table>
                    <ul class="set1">
                        <li class="setcont_bg">审核战队</li>
                        <li>
                        <span class="webname">
                            #if($!team.teamStatus==0)
                            <select class="teamStatus">
                                <option value="0" selected>未激活</option>
                                <option value="1">普通战队</option>
                                <option value="2">职业战队</option>
                                <option value="3">待审核</option>
                            </select>
                            #elseif($!team.teamStatus==1)
                            <select class="teamStatus">
                                <option value="0">未激活</option>
                                <option value="1" selected>普通战队</option>
                                <option value="2">职业战队</option>
                                <option value="3">待审核</option>
                            </select>
                            #elseif($!team.teamStatus==2)
                            <select class="teamStatus">
                                <option value="0">未激活</option>
                                <option value="1">普通战队</option>
                                <option value="2" selected>职业战队</option>
                                <option value="3">待审核</option>
                            </select>
                            #elseif($!team.teamStatus==3)
                            <select class="teamStatus">
                                <option value="0">未激活</option>
                                <option value="1">普通战队</option>
                                <option value="2">职业战队</option>
                                <option value="3" selected>待审核</option>
                            </select>
                            #end
                        </span>
                        </li>
                        <li>
                            <span class="webname">
                            <input type="button" id="btn_checkTeam" value="审核战队"/>
                            </span>
                        </li>
                    </ul>

                </div>
            </div>
        </form>
        <div id="show_bigImg" style="display: none;margin: auto;">
            <img src="" id="bigImg" width="500" height="400">
            <div class="close">关闭</div>
        </div>
    </div>
</div>
<script>
    function showBigImg(picPath){
        $('#show_bigImg').css('display','block');
        $('#bigImg').attr('src',picPath);
    }
    $('.close').click(function () {
        $('#show_bigImg').css('display','none');
    })
    $('#btn_teamName').click(function () {
        var teamName=$('#teamName').val();
        $.ajax({
            url:'$!webPath/admin/modifiedTeamName',
            type:'post',
            data:{teamId:'$!team.id',newName:teamName},
            success: function () {
                window.location.href = "$!webPath/admin/review_team?teamId=$!team.id";
            },
            error:function(){
                alert('失败');
            }
        })
    })
    $('#btn_checkTeam').click(function(){
        var teamStatus=$('.teamStatus option:selected').val();
        var get_data={
            teamId:'$!team.id',
            status:teamStatus
        }
        $.ajax({
            url:'$!webPath/admin/review_team',
            type:'post',
            data:get_data,
            success: function () {
                window.location.href = "$!webPath/admin/review_team?teamId=$!team.id";
            },
            error:function(){
                alert('失败');
            }
        })
    })

</script>
</body>
</html>
